package com.wugz.app.zookeeperconfig.controller;

import com.lagou.export.RpcExportUtils;
import com.wugz.app.zookeeperconfig.mapper.TBResumeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 测试controller
 */
@RestController
public class TestController {

    @Autowired
    private TBResumeMapper tbResumeMapper;

    /**
     * 访问数据
     */
    @GetMapping("")
    public List<Map<String, Object>> get() {
        return tbResumeMapper.getAll();
    }

    /**
     * 修改jdbc user
     */
    @GetMapping("pwd/{pwd}")
    public String change(@PathVariable String pwd) throws Exception {
        RpcExportUtils.update(pwd);
        return "success";
    }
}
